package com.sunny.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "sun_local_dir", schema = "crawler", catalog = "")
public class SunLocalDirEntity {
    private long dirId;
    private long diskId;
    private String path;
    private String comment;
    private Integer type;

    @Id
    @Column(name = "dir_id")
    public long getDirId() {
        return dirId;
    }

    public void setDirId(long dirId) {
        this.dirId = dirId;
    }

    @Basic
    @Column(name = "disk_id")
    public long getDiskId() {
        return diskId;
    }

    public void setDiskId(long diskId) {
        this.diskId = diskId;
    }

    @Basic
    @Column(name = "path")
    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    @Basic
    @Column(name = "comment")
    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SunLocalDirEntity that = (SunLocalDirEntity) o;
        return dirId == that.dirId &&
                diskId == that.diskId &&
                Objects.equals(path, that.path) &&
                Objects.equals(comment, that.comment);
    }

    @Override
    public int hashCode() {
        return Objects.hash(dirId, diskId, path, comment);
    }

    @Basic
    @Column(name = "type")
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
